/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aboutUs;

import javax.swing.JDesktopPane;
import utils.UtilsWindow;

/**
 *
 * @author linux
 */
public class AboutFrameController {
    private static AboutFrameController instance;
    private AboutFrame aFrame;
    
    public static AboutFrameController getInstance(){
        if(instance == null){
            instance = new AboutFrameController();
        }
        return instance;
    }
    
    public void show(JDesktopPane desktop) {
        if (aFrame == null){
            aFrame = new AboutFrame();
            desktop.add(aFrame);
            //limipiarCamposPaciente(); 
            UtilsWindow.getCenterWindowCoordinates(desktop,aFrame); 
            aFrame.setVisible(true);
            
        }else {
            if(aFrame.isVisible()) {
                aFrame.toFront();
                aFrame.pack();
            }else {
                if(!desktop.isAncestorOf(aFrame)){
                    desktop.add(aFrame);
                }
                //limipiarCamposPaciente(); 
                UtilsWindow.getCenterWindowCoordinates(desktop,aFrame);              
                aFrame.setVisible(true);
            }
        }

    }
}
